/*
 * InputDialog.java
 */
package mtvotingserver;

/**
 * @author George Lawie 0401739
 * CM3033 Concurrent Programming, Semester 1 2011/12
 * 
 * InputDialog
 * 
 * This is a modified input dialogue. It contains ten text fields for entry of
 * up to ten housemates' names. As with View, all listeners and manipulation of
 * elements is done within the ViewController.
 * 
 * The standard X/Close button on the dialog window has been disabled, to ensure
 * data is entered. */
public class ViewInputDialog extends javax.swing.JDialog {

    /** Creates new form InputDialog */
    public ViewInputDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        inputTextField1 = new javax.swing.JTextField();
        inputTextField2 = new javax.swing.JTextField();
        inputTextField3 = new javax.swing.JTextField();
        inputTextField4 = new javax.swing.JTextField();
        inputTextField5 = new javax.swing.JTextField();
        inputTextField6 = new javax.swing.JTextField();
        inputTextField7 = new javax.swing.JTextField();
        inputTextField8 = new javax.swing.JTextField();
        inputTextField9 = new javax.swing.JTextField();
        inputTextField10 = new javax.swing.JTextField();
        confirmButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Enter Housemates For Eviction");
        setAlwaysOnTop(true);
        getContentPane().setLayout(new java.awt.GridLayout(12, 1));

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("    Enter housemates' names here. Leave fields blank if there are less than ten.    ");
        getContentPane().add(jLabel1);

        inputTextField1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        getContentPane().add(inputTextField1);

        inputTextField2.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        getContentPane().add(inputTextField2);

        inputTextField3.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        getContentPane().add(inputTextField3);

        inputTextField4.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        getContentPane().add(inputTextField4);

        inputTextField5.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        getContentPane().add(inputTextField5);

        inputTextField6.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        getContentPane().add(inputTextField6);

        inputTextField7.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        getContentPane().add(inputTextField7);

        inputTextField8.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        getContentPane().add(inputTextField8);

        inputTextField9.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        getContentPane().add(inputTextField9);

        inputTextField10.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        getContentPane().add(inputTextField10);

        confirmButton.setText("Confirm details");
        getContentPane().add(confirmButton);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // getters to allow ViewController safe access
    public javax.swing.JTextField[] getInputs() {
        javax.swing.JTextField[] inputs = new javax.swing.JTextField[10];
        inputs[0] = inputTextField1;
        inputs[1] = inputTextField2;
        inputs[2] = inputTextField3;
        inputs[3] = inputTextField4;
        inputs[4] = inputTextField5;
        inputs[5] = inputTextField6;
        inputs[6] = inputTextField7;
        inputs[7] = inputTextField8;
        inputs[8] = inputTextField9;
        inputs[9] = inputTextField10;
        return inputs;
    }
    
    public javax.swing.JTextField getFirstInput() {
        return inputTextField1;
    }
    
    public javax.swing.JButton getConfirmButton() {
        return confirmButton;
    }
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton confirmButton;
    private javax.swing.JTextField inputTextField1;
    private javax.swing.JTextField inputTextField10;
    private javax.swing.JTextField inputTextField2;
    private javax.swing.JTextField inputTextField3;
    private javax.swing.JTextField inputTextField4;
    private javax.swing.JTextField inputTextField5;
    private javax.swing.JTextField inputTextField6;
    private javax.swing.JTextField inputTextField7;
    private javax.swing.JTextField inputTextField8;
    private javax.swing.JTextField inputTextField9;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
}
